package com.fer.tankr.controllers;

import org.andengine.engine.camera.Camera;
import org.andengine.entity.scene.IOnSceneTouchListener;
import org.andengine.entity.scene.Scene;
import org.andengine.input.touch.TouchEvent;

import android.util.Log;

import com.fer.andenginemvc.api.Controller;
import com.fer.tankr.MainActivity;
import com.fer.tankr.scenes.CreditsScene;
import com.fer.tankr.scenes.SceneManagerImpl;

public class CreditsController extends Controller<MainActivity> implements IOnSceneTouchListener{

	public CreditsController(MainActivity baseGame, Camera camera)  {
		super(new CreditsScene(camera, baseGame.getVertexBufferObjectManager(), baseGame.assetManager.creditsScreen), baseGame, camera);
		getScene().setOnSceneTouchListener(this);
	}

	public CreditsScene getScene()
	{
		return (CreditsScene)scene;
	}
	
	@Override
	public void onShow() {
		camera.setChaseEntity(scene);
	}

	@Override
	public boolean onSceneTouchEvent(Scene pScene, TouchEvent pSceneTouchEvent) {
		Log.d("Credits", "Credits touched");
		baseGame.setScene(SceneManagerImpl.MENU);
		return true;
	}


}
